<?php
/**
 * 日志助手
 * User: wyj
 * Date: 2018/1/22
 * Time: 14:22
 */

namespace Helper;


class Log
{
    public static function print($message, $code = false, $line = 0, $path = false)
    {
        if ($code === false) {
            $message = sprintf("%s [%s]\n", $message, date('Y-m-d H:i:s'));
        } else {
            $message = sprintf("%s, ErrCode[%d] line: %d [%s]\n", $message, $code, $line,date('Y-m-d H:i:s'));
        }
        echo $message;
        return true;
    }
}